//
//  HACBasicComponents.h
//  Pods
//
//  Created by Hotacool on 2017/8/30.
//
//

#import "HACChartComponent.h"

typedef NS_ENUM(NSUInteger, HACAxisLabelPosition) {
    HACAxisLabelPositionInside,
    HACAxisLabelPositionOutside
};
#pragma mark -------- Axis
@interface HACAxisComponents : HACChartComponent
/** 轴的类型 */
@property (nonatomic) DrawingAxisType axisType;
/** 自定义label颜色，否则红绿色 */
@property (nonatomic, assign) BOOL customLabelColor;
/** label的个数 */
@property (nonatomic, assign) NSUInteger labelCount;
/** label的宽度 */
@property (nonatomic, assign) CGFloat labelWidth;
/** label的位置 */
@property (nonatomic, assign) HACAxisLabelPosition labelPosition;
/** 显示坐标格 */
@property (nonatomic, assign) BOOL showGrid;
/** label的格式化 */
@property (nonatomic, strong) NSString *customFormat;
/** 最小值 */
@property (nonatomic, assign) double axisMinimum;
/** 自定义最小值 */
@property (nonatomic, assign) BOOL customAxisMin;
/// axis space from the largest value to the top in percent of the total axis range
@property (nonatomic, assign) CGFloat spaceTop;
/// axis space from the smallest value to the bottom in percent of the total axis range
@property (nonatomic, assign) CGFloat spaceBottom;

// 扩展文字
@property (nonatomic, copy) NSString *extText;
@property (nonatomic) CGRect extTextFrame;
@property (nonatomic) NSTextAlignment extTextAlignment;
@property (nonatomic, strong) UIColor *extTextColor;
@property (nonatomic, strong) UIFont *extTextFont;
@end

#pragma mark --- HACLineComponents

/** 绘制线集合的item，同时支持point基础类型数组和array，CGPoint优先 */
@interface HACLineComponents : HACChartComponent <NSCopying>

/** 点的个数 */
@property (nonatomic) NSInteger pointCount;
/** 将所有的点转成nsstring存放的集合 */
@property (nonatomic) NSArray *pointArray;;
/** 直线上所有点的集合 */
@property (nonatomic) CGPoint *linePoints;
/** 是否为曲线 */
@property (nonatomic) BOOL isCurve;
/** 是否为渐变 */
@property (nonatomic, assign) BOOL isGradient;
/** 是否存在无效值，即集合中是否有不需要绘制的点(只能是在头几个或者尾几个部分) */
@property (nonatomic) BOOL hasInvaildValue;

@end

#pragma mark -------- HACChartComponent

@interface HACRectComponents : HACChartComponent

@property (nonatomic) CGRect pillarRect; /** 柱子的frame，y坐标从上往下 */
@property (nonatomic) BOOL isSoildFill; /** 是否实心 */
@property (nonatomic) CGFloat center; /** 中线的坐标 */

// 矩形上下的直线
@property (nonatomic) CGLine line1;
@property (nonatomic) CGLine line2;

@end

#pragma mark -------- HACFocusComponents

@interface HACFocusComponents : HACChartComponent

/** 轴的类型 */
@property (nonatomic) DrawingAxisType axisType;
/**背景或者图片frame*/
@property (nonatomic) CGFloat cornerRadius;
@property (nonatomic) CGFloat borderWidth;
@property (nonatomic, strong) UIColor *borderColor;
@property (nonatomic, strong) UIColor *bgColor;

@property (nonatomic, retain) UIImage *bgImg;
@property (nonatomic) CGRect bgImgRect;

/** 附带文字 */
@property (nonatomic, copy) NSString *extText;
@property (nonatomic, assign) CGRect extTextFrame;

@end

